package com.youlu.campus.entity.VO.req;

import com.youlu.campus.base.community.RankingList;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class RankingListResVO implements Serializable {
    /**
     * 名字
     */
    private String name;
    /**
     * 排行榜图片
     */
    private String imageUrl;
    /**
     * 排行榜详情
     */
    private String detail;
    /**
     * 排名
     */
    private Integer orderNo = 0;
    /**
     * 工作量
     */
    private Double quantity = 0D;
    /**
     * 是否入榜,默认未入榜
     */
    private Boolean inRanking = Boolean.FALSE;


    private List<RankingList> datas = new ArrayList<>();

    private Integer page;

    private Integer pageSize;

    private Integer totalPages = 0;

    /**
     * 总数
     */
    private Integer total = 0;

    public void setTotal(Integer total) {
        this.total = total;
        //计算总页数
        if (total > 0) {
            this.totalPages = total / this.pageSize;
            if (total % this.pageSize != 0) {
                this.totalPages = totalPages + 1;
            }
        }
    }

    private String rankValue;
    /**
     * 是否有下一页
     */
    private boolean hasNext = false;


}
